/* 
 * File:   Texture.h
 * Author: agu
 *
 * Created on 22 de mayo de 2014, 15:34
 */

#ifndef TEXTURE_H
#define	TEXTURE_H
#include <SDL2/SDL.h>
#include <string>
#include "client_Surface.h"
using std::string;

class Texture {
public:
    Texture();
    Texture(SDL_Renderer* renderer, int x, int y);
    Texture(SDL_Renderer* renderer, const string path, int x, int y);
    Texture(SDL_Renderer* renderer, const string path);
    Texture(const Texture& orig);
    void setRender(SDL_Renderer* renderer);
    //Set color modulation
    void setColor(Uint8 red, Uint8 green, Uint8 blue);
    //Set blending
    void setBlendMode(SDL_BlendMode blending);
    //Set alpha modulation
    void setAlpha(Uint8 alpha);
    //Renders texture at given point
    void render(); //Para imagenes que nunca van a cambiar
    void render(SDL_Rect* clip); //Para imagenes que solo cambian lo que muestran
    void render(int x, int y, SDL_Rect* clip); //Para imagenes que cambian de pos
    void render(int x, int y, int width, int height);
    void render(int x, int y, int width, int height, SDL_Rect* clip); //Pos y tam
    void render(int x, int y, SDL_Rect* clip, double angle,
            SDL_Point* center, SDL_RendererFlip flip); //pos, tam y rotan

    //Gets image dimensions
    int getWidth();
    int getHeight();
    //Get image positions
    int getX();
    int getY();
    SDL_Texture* getTextureSDL();
    //set image dimensions
    void resize(int width, int height);
    void setPosition(int x, int y);
    void load(Surface& surface);
    ~Texture();
private:
    SDL_Rect position;
    SDL_Texture* texture;
    SDL_Renderer* renderer;
};

#endif	/* TEXTURE_H */

